﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Administrator.Master" AutoEventWireup="true" CodeBehind="FAQ.aspx.cs" Inherits="ProjectSemIII.Administrator.Support.FAQ" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    FAQ
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="pagination">
        <asp:Label Text="Error dfgserfg jdksgbjksdb fjrkwb fvkjs bdjvkr t" runat="server" ID="lbError"></asp:Label>
    </div>
    <div class="fluid">
        <form id="validate" class="main" method="post" action="POST">
            <fieldset>
                <div class="widget">
                    <div class="whead">
                        <h6>Create New FAQ:</h6>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>FAQ Catalog:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <div class="selector">
                                <span runat="server" id="nameChoose">Select FAQ Catalog</span>
                                <asp:DropDownList AutoPostBack="true" ID="ddFAQCatalog" runat="server" Width="145px" OnSelectedIndexChanged="ddFAQCatalog_SelectedIndexChanged">
                                    <asp:ListItem Value="-1" Text="Select FAQ Catalog"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="FAQ For Account"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="FAQ For Survey"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Question Detail:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <CKEditor:CKEditorControl ID="txtQuestion" AutoCompleteType="BusinessCity" BasePath="~/ckeditor" CssClass="validate[required]" runat="server"></CKEditor:CKEditorControl>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Question Detail:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <CKEditor:CKEditorControl ID="txtAnswer" BasePath="~/ckeditor" CssClass="validate[required]" runat="server"></CKEditor:CKEditorControl>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label><span class="req"></span></label>
                        </div>
                        <div class="grid9">
                            <asp:Button ID="btSubmit" Text="Submit" OnClick="btSubmit_Click" runat="server" CssClass="buttonS bLightBlue" />
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>

    <div class="divider"><span></span></div>

    <div class="pagination">
        <asp:Repeater ID="totalPage" runat="server">
            <HeaderTemplate>
                <ul class="pages">
                    <li class="prev">
                        <asp:LinkButton runat="server" ID="btPrev" OnClick="btPrev_Click">&lt;</asp:LinkButton></li>
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <asp:LinkButton runat="server" ID="PageNumber" OnClick="PageNumber_Click" Text='<%# Container.DataItem.ToString() %>'></asp:LinkButton></li>
            </ItemTemplate>
            <FooterTemplate>
                <li class="next">
                    <asp:LinkButton runat="server" ID="btNext" OnClick="btPrev_Click">&gt;</asp:LinkButton></li>
                </ul>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <div class="widget">
        <div class="whead">
            <h6>All Survey</h6>
            <div class="clear"></div>
        </div>
        <asp:Repeater ID="allFAQ" runat="server" OnItemCommand="allFAQ_ItemCommand">
            <HeaderTemplate>
                <table cellpadding="0" cellspacing="0" width="100%" class="tDefault checkAll tMedia" id="checkAll">
                    <thead>
                        <tr>
                            <td width="50">ID</td>
                            <td class="sortCol">
                                <div>FAQ Question<span></span></div>
                            </td>
                            <td class="sortCol">
                                <div>FAQ Answer<span></span></div>
                            </td>
                            <td class="sortCol">
                                <div>FAQ Catalog<span></span></div>
                            </td>
                            <td width="100">Actions</td>
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td><%# Eval("FAQID") %></td>
                    <td class="textL"><%# Eval("Question").ToString().Length < 100 ?  Eval("Question").ToString().Substring(5,Eval("Question").ToString().Length-6) : Eval("Question").ToString().Substring(5,94)+" ..."%></td>
                    <td class="textL"><%# Eval("Answer").ToString().Length < 100 ?  Eval("Answer").ToString().Substring(5,Eval("Answer").ToString().Length-6) : Eval("Answer").ToString().Substring(5,94)+" ..."%></td>      
                    <td class="textL">
                        <asp:Label ID="lbStatus" runat="server" Text='<%# Eval("FAQCatalog").ToString() == "1" ? "FAQ For Account" : "FAQ For Survey"%>'></asp:Label></td>
                    <td class="tableActs">
                        <asp:ImageButton ID="ibEditSurvey" CommandName="Edit" CommandArgument='<%# Eval("FAQID") %>' Width="11px" Height="11px" ImageUrl="~/App_Themes/Administrator/images/icons/update.png" runat="server" CssClass="tablectrl_small bDefault tipS" title="Edit"></asp:ImageButton>
                        <asp:ImageButton ID="ibDeleteSurvey" CommandName="Delete" Width="11px" Height="11px" OnClientClick="return confirm('Are you sure that you want to delete this FAQ?');" CommandArgument='<%# Eval("FAQID") %>' ImageUrl="~/App_Themes/Administrator/images/icons/delete.png" runat="server" CssClass="tablectrl_small bDefault tipS" title="Remove"></asp:ImageButton>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
</asp:Content>
